package controller
{
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import org.robotlegs.mvcs.Command;
	
	import subumbo.leg.model.vo.ResizeVO;
	import subumbo.leg.view.signal.ResizeSignal;
	import subumbo.leg.view.signal.ViewConstructSignal;
	
	import view.background.Background;
	import view.create.Create;
	import view.wrapper.Wrapper;

	public class StartupCommand extends Command {
		
		[Inject] public var construct:ViewConstructSignal;
		[Inject] public var resize:ResizeSignal;
		
		public override function execute():void {
			
			contextView.stage.scaleMode = StageScaleMode.NO_SCALE;
			contextView.stage.align = StageAlign.TOP_LEFT;
			
			var wrapper:Wrapper = new Wrapper();
			wrapper.addChild(new Create());
			contextView.addChild(new Background());
			contextView.addChild(wrapper);
			construct.dispatch();
			
			resize.dispatch(new ResizeVO(contextView.stage.stageWidth, contextView.stage.stageHeight))
			
		}
	}
}